package server;

import java.io.IOException;

public class OldLagouServlet extends HttpServlet {
    @Override
    public void inti() {

    }

    @Override
    public void destroy() {

    }

    @Override
    public void doGet(Request request, Response response) {
        // 模拟休眠
//        try {
//            Thread.sleep(100000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        String content = "<h1>demo2 OldLagouServlet get</h1>";
        try {
            response.output(HttpProtocolUtil.getHttpHeader200(content.length()) + content);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void doPost(Request request, Response response) {
        String content = "<h1>OldLagouServlet post</h1>";
        try {
            response.output(HttpProtocolUtil.getHttpHeader200(content.length()) + content);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
